﻿class towerBlock extends MovieClip{
	private var name:String;
	private var hp:Number;
	private var parent:tower;
	
	public function towerBlock(){
		hp = 20;
	}
	
	public function cleanUp(){
		parent.removePiece(this, parent.getParent().getWizard());
	}
	
	/**
	 * Sets the starting variables for this towerBlock
	 * @param setName the name to set
	 * @param setHP the value to set the hp to	 */
	public function initTowerBlock(setName:String, setHP:Number):Void{
		name = setName;
		hp = setHP;
	}
	
	/**
	 * Creates a clone of this towerBlock
	 * @return a clone of this towerBlock	 */
	public function clone():towerBlock{
		var t:towerBlock = new towerBlock();
		t.initTowerBlock(name, hp);
		return t;
	}
	
	/**
	 * Gets the name of this towerBlock
	 * @return the name of this towerBlock	 */
	public function getName():String{
		return name;
	}
	
	/**
	 * Makes parameter into a copy of this
	 * @param t The towerBlock to transform
	 */
	public function duplicate(t:towerBlock):Void{
		t.initTowerBlock(name, hp);
	}
	
	/**
	 * Sets the parent tower for this towerBlock
	 * @param p the tower to set the parent to	 */
	public function setParent(p:tower):Void{
		parent = p;	
	}
	
	/**
	 * Gets the parent of this towerBlock
	 * @return the parent for this towerBlock	 */
	public function getParent():tower{
		return parent;
	}
}